Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

204
Visualizações
How to update global custom user properties in Google Analytics 4 [GA4]?

With Google Analytics 4 [GA4] it's possible to add custom user properties to each event.

  1. Optional: Add any custom user properties that you'd like to configure in User Properties.

This is explained further in [GA4] About event parameters.

Now, this code works fine and the value of test is appended to the initial page_view and other following events:

gtag('config', 'G-1234567890', {
  test: false
});

Our site is a single page application (SPA) and at some point we want to update the parameter test.

The mentioned docs and also the Global site tag API reference set say, these parameters can be updated at any time. I found these two versions:

gtag('set', 'user_properties', {test: true});
gtag('set', {test: true});

Unfortunately, both won't work. I can get the updated parameter successfully using get:

gtag('get', 'G-1234567890', 'test', (test) => {
  console.log(test); // true
});

But the value is never updated for any subsequent request to Google Analytics and test: false is tracked all the time.

What are we doing wrong?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda